package com.enjoyor.health.HGPT.core.service.impl;

import com.enjoyor.health.HGPT.core.dto.*;
import com.enjoyor.health.HGPT.core.entity.ReportData;
import com.enjoyor.health.HGPT.core.mapper.ReportDataMapper;
import com.enjoyor.health.HGPT.core.service.IReportDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Maps;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author enjoyor
 * @since 2023-10-18
 */
@Service
public class ReportDataServiceImpl extends ServiceImpl<ReportDataMapper, ReportData> implements IReportDataService {

    @Override
    public List<ReportBayaDto> getReportBayaByReportId(String reportId) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("report_id", reportId);
        return baseMapper.getReportBayaByReportId(map);
    }

    @Override
    public List<ReportDataScoreDto> getReportDataScoreDtoByReportId(String reportId) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("report_id", reportId);
        return baseMapper.getReportDataScoreDtoByReportId(map);
    }

    @Override
    public List<ReportDataSystemScoreDto> getReportDataSystemScoreDtoByReportId(String reportId, String organ) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("report_id", reportId);
        map.put("system_name_en", organ);
        return baseMapper.getReportDataScoreDtoByIdAndSystem(map);
    }

    @Override
    public List<ReportDataCancerDto> getReportDataCancerDtoList(String reportId) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("report_id", reportId);
        return baseMapper.getReportDataCancerDtoList(map);
    }

    @Override
    public List<ReportDataChronicsDto> getReportDataChronicsDtoList(String reportId) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("report_id", reportId);
        return baseMapper.getReportDataChronicsDtoList(map);
    }

    @Override
    public List<ReportDataBrainDto> getReportDataBrainDtoList(String reportId) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("report_id", reportId);
        return baseMapper.getReportDataBrainDtoList(map);
    }

    @Override
    public List<ReportDataHeartDto> getReportDataHeartDtoList(String reportId) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("report_id", reportId);
        return baseMapper.getReportDataHeartDtoList(map);
    }

    @Override
    public List<ReportDataNormalDto> getReportDataNormalDtoList(String reportId) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("report_id", reportId);
        return baseMapper.getReportDataNormalDtoList(map);
    }

    @Override
    public List<ReportDataBioDto> getReportDataBioDtoList(String reportId, String organ) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("report_id", reportId);
        map.put("system_name_en", organ);
        return baseMapper.getReportDataBioDtoList(map);
    }
}
